﻿
using System.Collections.ObjectModel;

namespace Mal.Balades.Admin.ViewModels.VisitViewModels.Edit
{
    public class PicturesTabViewModel : TabViewModelBase
    {
        #region Fields
        private ObservableCollection<PictureViewModel> picturesToDisplay;
       
			
        #endregion

        #region Construction / Destruction
        public PicturesTabViewModel(VisitEditViewModel parent)
            : base(parent)
        {
            this.AddCommandEnabled = true;
            this.SourceVisit.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(SourceVisit_PropertyChanged);
        }

       
        #endregion

        #region enum, struct, class

        #endregion

        #region Properties
        public override string TabHeader
        {
            get { return "Photos"; }
        }

        public ObservableCollection<PictureViewModel> PicturesToDisplay
        {
            get { return picturesToDisplay; }
            set
            {
                if (picturesToDisplay != value)
                {
                    picturesToDisplay = value;
                    RaisePropertyChanged("PicturesToDisplay");
                }
            }
        }
        #endregion

        #region Methods
        public override void Add()
        {
            //this.ParentViewModel.SourceVisit.Pictures.Add(new PictureViewModel(new Picture()));

            this.ParentViewModel.SourceVisit.Pictures.Add(new PictureViewModel());
        }

        public override void Remove()
        {
            
        }
        #endregion

        #region Events
        void SourceVisit_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "Pictures")
            {

            }
        }
        #endregion




    }
}
